package com.bw.common.utils

import android.content.Context
import com.bw.common.dialog.LoadingDialog

object DialogUtils {
    private var loadingDialog:LoadingDialog? = null
    fun showLoading(context:Context,loadingText:String = "加载中..."){
        //把之前的Dialog关闭掉
        dismissLoading()

        //创建Loading对象
        loadingDialog = LoadingDialog(context,loadingText)

        //显示Dialog
        loadingDialog?.show()
    }
    fun dismissLoading(){
        loadingDialog?.dismiss()
        loadingDialog = null
    }
}